﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Win32;
using ProjectWizardManagementv1.Infrastructure.Concrete;

namespace ProjectWizardManagementv1.WpfComponents.UserControls
{
    /// <summary>
    /// Interaction logic for AdvanceRichTextEditor.xaml
    /// </summary>
    public partial class PlainTextEditor : UserControl
    {
        public string DestinationPath { get; set; }

        public PlainTextEditor()
        {
            InitializeComponent();
        }

        private void Save_SaveDocument(object sender, RoutedEventArgs e)
        {
            if(File.Exists(DestinationPath))
            {
                using(var writer = new StreamWriter(DestinationPath))
                    writer.Write(Body.Text);
            }
        }

    }
}
